package tt.t;

import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
@EnableConfigurationProperties(MytestProperties.class)
@ConditionalOnProperty(prefix = "mytest", value = "enable", matchIfMissing = true)
@ConditionalOnWebApplication
public class MytestConfiguration {
    @Bean
    public IService myService(MytestProperties properties) {
        return new IServiceImpl(properties);
    }
}
